<template>
  <view class="box">
    <view class="left">
      <image :src="info.avatar" class="headImage" mode="scaleToFill" />
      <view class="nameBox">
        <view class="name">
          <text>{{ info.name }}</text>
          <image v-if="info.level === '1'" src="../static/home/hg.png" mode="scaleToFill" />
        </view>
        <view class="zw">{{ info.job }}</view>
        <view class="gs">{{ info.company }}</view>
      </view>
    </view>
    <view class="lxt" @click.stop="goltPage">联系他</view>
  </view>
</template>

<script lang="ts" setup>
import { goPage } from "@/utils/commonFn";

const { info, isMyFriends } = defineProps<{
  info: myTypes.myFriendsList;
  isMyFriends?: boolean;
}>();
const goltPage = () => {
  if (isMyFriends) {
    goPage(`/pages/message/chatPage?id=${info.userId}&name=${info.name}`);
  } else {
    goPage(`/pages/myPage/MyBusinessCard/MyBusinessCard?cardId=${info?.userId}&pageType=other`);
  }
};
</script>

<style scoped lang="less">
.box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20rpx;
  margin-bottom: 32rpx;
  border-bottom: 1px solid #f5f7f9;
  .left {
    display: flex;
    .headImage {
      width: 88rpx;
      height: 88rpx;
      background: salmon;
      margin-right: 24rpx;
      border-radius: 50%;
    }
    .nameBox {
      .name {
        font-size: 32rpx;
        font-family: PingFangSC, PingFang SC;
        font-weight: 500;
        color: #1e1e1e;
        line-height: 44rpx;
        image {
          width: 28rpx;
          height: 28rpx;
          margin-left: 10rpx;
        }
      }
      .zw {
        font-size: 24rpx;
        font-family: PingFangSC, PingFang SC;
        font-weight: 400;
        color: #bebebe;
        line-height: 46rpx;
        margin-top: 8rpx;
      }
      .gs {
        font-size: 24rpx;
        font-family: PingFangSC, PingFang SC;
        font-weight: 400;
        color: #bebebe;
        line-height: 46rpx;
      }
    }
  }
  .lxt {
    background: #e7f1fe;
    border-radius: 28rpx;
    padding: 10rpx 24rpx;
    font-size: 26rpx;
    font-family: PingFangSC, PingFang SC;
    font-weight: 500;
    color: #1676fd;
    line-height: 36rpx;
    margin-top: -20rpx;
  }
}
</style>
